<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>预约挂号hospital.html</title>
    <link rel="stylesheet" type="text/css" href="css/aui.css" />
		<link rel="stylesheet" type="text/css" href="css/main.css" />
</head>
<body>
    <div class="site-name">
      <p>北京114预约挂号平台</p>
    </div>
    <div class="hospital-container">

<!--      <div class="hospital-wrapper">-->
<!--        <div class="hospital-logo">-->
<!--          <img src="images/hos_1.png" alt="">-->
<!--        </div>-->
<!--        <div class="hospital-info">-->
<!--          <h4>北京协和医院</h4>-->
<!--          <p>三级甲等</p>-->
<!--          <p>每日8:30开放</p>-->
<!--        </div>-->
<!--        <a class="hospital-look" href="hoslook.html">-->
<!--          <img src="images/look.png" alt="">-->
<!--          <span>医院详情</span>-->
<!--        </a>-->
<!--      </div>-->
      <div class="search-container">
        <div class="search-wrapper">
          <div class="search-icon">
            <i class="aui-iconfont aui-icon-search"></i>
          </div>
          <div class="search-input">
            <input placeholder="搜索科室" autocomplete="off" id="search-office" value=""/>
          </div>
        </div>
      </div>
    </div>

    <div class="type-container hospital-type-container">
      <div class="type-left">
        <div class="type-left-list" id="office">
<!--          <div class="type-left-item type-active">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">核酸检测</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">全科医疗科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">内科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">外科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">重症医学科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">急症介入科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">肿瘤科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">妇产科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">儿科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">小儿外科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">眼科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">耳鼻喉头颈外科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">口腔科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">皮肤科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">医疗美容科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">精神科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">结核病科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">地方病科</a>-->
<!--          </div>-->
<!--          <div class="type-left-item">-->
<!--            <i></i>-->
<!--            <a href="javascript:;">康复医学科</a>-->
<!--          </div>-->
        </div>
      </div>
      <div class="type-right" id="rightdiv">
<!--        <div class="type-right-list">-->
<!--          <div class="type-right-item">-->
<!--            <a href="yuyue.html">核酸检测</a>-->
<!--          </div>-->
<!--        </div>-->
      </div>
    </div>
<input type="hidden" id="getid" name="getid" value=""/>
</body>
<script src="js/jquery.min.js"></script>
<script src="js/url.js"></script>
<script type="text/javascript">
  var hospitalId = location.href.split("=")[1];
  //alert(decodeURI(hospitalId));
  $.ajax({
    type:"get",
    dataType:"json",
    url:"wechat114/Hospital/HospitalById",
    data:{"hospitalId":hospitalId},
    success:function (data) {
      var arrList = data.data;
      var str = "<div class=\"hospital-wrapper\">\n" +
              "        <div class=\"hospital-logo\">\n" +
              "          <img src=\""+arrList.hospitalImage+"\" alt=\"\">\n" +
              "        </div>\n" +
              "        <div class=\"hospital-info\">\n" +
              "          <h4>"+arrList.hospitalName+"</h4>\n" +
              "          <p>"+arrList.hospitalLevel+"</p>\n" +
              "          <p>"+arrList.numberallocationTime+"</p>\n" +
              "        </div>\n" +
              "        <a class=\"hospital-look\" href=\"hoslook.html?hospitalId="+arrList.hospitalId+"\">\n" +
              "          <img src=\"images/look.png\" alt=\"\">\n" +
              "          <span>医院详情</span>\n" +
              "        </a>\n" +
              "      </div>";

      $(".hospital-container").append(str);
    }
  })

  /*一二级菜单显示部分head*/
  showMenu(hospitalId);
  function showMenu(hospitalId){
    //alert(hospitalId);
    $.ajax({
      type:"get",
      dataType:"json",
      data:{"hospitalId":hospitalId, "chiefofficesId":0},
      url:getUrl()+"wechat114/Hospital/getHospitalDetail",
      success:function (data) {
        var length = data.data.length;
        var str = "";
        for (var i=0; i<length; i++){
          str +=  "<div class=\"type-left-item\" id=\"ltitem\"> \n" +
                  "<a href=\"javascript:;\" name=\""+data.data[i].officesId+"\">"+data.data[i].officesName+"</a> \n" +
                  "</div>";
        }
        $("#office").append(str);

        $('.type-left-item').click(function () {
          //alert($(this).html().split("\"")[3]);
          $('.type-left-item').removeClass('type-active');
          $(this).addClass('type-active');
          $.ajax({
            type:"get",
            dataType:"json",
            data:{"hospitalId":hospitalId, "chiefofficesId":$(this).html().split("\"")[3]},
            url:getUrl()+"/wechat114/Hospital/getHospitalDetail",
            success:function (data) {
              var length = data.data.length;
              var str = "";
              for (var i=0; i<length; i++) {
                str += "<div class=\"type-left-item \" > \n" +
                        "<a href=\"yuyue.html?officesId="+encodeURI(data.data[i].officesId)+"&hospitalId="+encodeURI(data.data[i].hospitalId)+"\" id=\"getid\">" + data.data[i].officesName + "</a> \n" +
                        "</div>";
              }0
              $("#rightdiv").html(str);
            }
          })
        })

      }
    });
  }

  /*一二级菜单显示部分ending*/

</script>
<script>
    /*搜索栏部分head*/
    $(".search-icon").click(function () {
        var officesName = $("#search-office").val();
        $.ajax({
            type:"get",
            dataType:"json",
            data:{"hospitalId":hospitalId,"officesName":officesName},
            url:getUrl()+"/wechat114/Hospital/getOneHospital",
            success:function (data) {
                //alert(data.data.hospitalId+"**"+data.data.officesId);
                /*把值带给yuyue.html页面操作*/
                location.href ="yuyue.html?officesId="+encodeURI(data.data.officesId)+"&hospitalId="+encodeURI(data.data.hospitalId)+"";

            }
        })
    })
    /*搜索栏部分ending*/
</script>

<script>

</script>
</html>
